<template>
  <div class="search-content">
    <div class="tag">
      <span>搜索结果"{{$route.query.keywords}}"</span>
    </div>
    <article-list :type="type" :keywords="keywords"></article-list>
  </div>
</template>
<script>
  var articleList = require("../../components/user/article-list.vue");
  export default{
		data(){
			return {
        type:"search",
        keywords:""
			}
		},
    components:{
      articleList:articleList
    },
		route:{
			data(transition){
        var keywords = transition.to.query.keywords;
        if(keywords && keywords != "true"){
          this.keywords = keywords;
        }else{
          alert("关键词是空的,来个JB");
          this.$route.router.go("/");
        }
      }
    }
  }
</script>
<style>
  @import url("../../resources/webSite/css/article-list.css");
  .search-content{
    width:100%;
  }
  .search-content .tag{
    width:100%;
    margin-bottom:30px;
  }
  .search-content .tag span{
    font-size:14px;
    padding:6px 12px;
    letter-spacing: 2px;
    display:inline-block;
    background:#55bef9;
    color:#fff;
  }
</style>
